package com.zkthink.ceres.promotion.entity;


import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * <p>
 * 实体类 分销员拥有别的分销产品
 * </p>
 *
 * @author kellen
 * @since 2020-12-05
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_sales_own_product")
@ApiModel(value = "SalesOwnProduct", description = "分销员拥有别的分销产品")
@AllArgsConstructor
public class SalesOwnProduct extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 会员ID
     */
    @ApiModelProperty(value = "会员ID")
    @TableField("mid")
    @Excel(name = "会员ID")
    private Long mid;

    /**
     * 产品id
     */
    @ApiModelProperty(value = "产品id")
    @TableField("product_id")
    @Excel(name = "产品id")
    private Long productId;

    /**
     * 逻辑删除 1-删除 0-未删除
     */
    @ApiModelProperty(value = "逻辑删除 1-删除 0-未删除")
    @NotNull(message = "逻辑删除 1-删除 0-未删除不能为空")
    @TableField("is_delete")
    @Excel(name = "逻辑删除 1-删除 0-未删除")
    @TableLogic
    private Integer isDelete;


    @Builder
    public SalesOwnProduct(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, Integer isDelete,
                           Long mid, Long productId) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.isDelete = isDelete;
        this.mid = mid;
        this.productId = productId;
    }
}
